package designerMode.observe;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liuchaoqun
 * @date 2022/9/12
 * @Description
 */
public class Subject {

    List<Observe> observeList = new ArrayList<>();

    Integer status;

    public void attach(Observe observe) {
        observeList.add(observe);
    }

    public void setStatus(Integer status) {
        this.status = status;
        notifyObserve();
    }

    public void notifyObserve(){
        for (Observe observe : this.observeList) {
            observe.Update();
        }
    }
}
